<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String base = request.getContextPath();
    request.setAttribute("base", base);
%>
<!doctype html>
<html lang="zh" class="pu">

<head>
    <!-- meta -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <!-- style -->

    <title>菲遇下载</title>
</head>

<body style="padding: 0px;margin: 0px;display: none;">

<div id="back">
    <img style="width:100%; height: 100%;" src="${base}/resources/images/download_bk.png?765566334">
    <div id="download" style="position:absolute;top:0px;"></div>
</div>

<div id="cover" style="position:absolute;display: none;">
    <img style="width:100%; height: 100%;" src="${base}/resources/images/download_cov_ios.png">
</div>

<!-- js -->
<script src="${base}/resources/js/zepto.min.js"></script>

<!-- javascript -->
<script>

    $(document).ready(function(){
        //计算显示尺寸
        countRect();
        $(window).resize(function () {
            countRect();
        });
        //显示内容
        $('body').show ();

        //获取请求来源
        var fromwx = '${fromwx}';
        if (fromwx == "false") {
            window.location.href = "https://itunes.apple.com/cn/app/fei-yu-quan-qiu-zhu-bo-ju/id1130258099?mt=8";
        }
        //下载按钮
        $('#download').click (function (){
            if (fromwx == "true") $('#cover').show ();
            else window.location.href = "https://itunes.apple.com/cn/app/fei-yu-quan-qiu-zhu-bo-ju/id1130258099?mt=8";
        });
        //点击隐藏
        $('#cover').click (function (){
            $('#cover').hide ();
        });
    });
    function countRect () {
        var ww = parseInt ($(window).width());
        var wh = parseInt ($(window).height());

        //背景
        $('#back').css ('width', ww);
        $('#back').css ('height', wh);
        $('#cover').css ('width', ww);
        $('#cover').css ('height', wh);
        $('#cover').css ('top', 0);

        //下载按钮
        $('#download').css ('border-radius', ww * 0.1);
        $('#download').css ('width', ww * 0.68);
        $('#download').css ('height', wh * 0.1);
        $('#download').css ('top', wh * 0.84);
        $('#download').css ('left', ww * 0.15);
    }
</script>

</body>
</html>